package com.cgmnx.admin.common.enums;


public enum ValidEnumType implements EnumTrait {
    VALID(0, "有效"),
    INVALID(1, "无效");

    private int code;
    private String text;

    ValidEnumType(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public static ValidEnumType codeOf(int code) {
        for (ValidEnumType type : ValidEnumType.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        return null;
    }

    @Override
    public int getCode() {
        return code;
    }

    public String getText() {
        return text;
    }
}